<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>滚动窗口</title>
    <style>
        body{
            height:200px;
        }
        .div1{
            width:150px;
            height:150px;
            background-color: pink;
            border:1px solid black;
            margin-top:50%;
        }

    </style>
</head>
<body>
<input type="button" value="dianji"/>
<div class="div1"></div>
<script>
    var oD=document.querySelector(".div1");
    document.querySelector("input").onclick=function(){
       oD.scrollIntoView(true);
    }
</script>
</body>
</html>